﻿using System;
using Microsoft.SharePoint;

namespace SharePoint.Orm.Metal.Rules {
	public abstract class ListRule {
		private readonly string _title;

		protected ListRule(string title) {
			_title = title;
		}

		public bool Match(SPList list) {
			if (_title == "*") {
				return true;
			}
			if (string.Equals(list.Title, _title, StringComparison.InvariantCultureIgnoreCase)) {
				return true;
			}
			return false;
		}
	}
}
